<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <style>
        @page {
            size: 279mm 200mm;
        }

        .head {
            width: 100%;
            height: 90px;
            text-align: center;
        }

        .head span {
            width: 100%;
            font-size: 30px;
            font-weight: 700;
            color: #333333;
            line-height: 41px;
            letter-spacing: 40px;

        }

        .headTable td {
            font-weight: bold;
        }

        .trMxTitle {
            font-size: 12px;
        }

        body {
            font-family: SimSun;
            font-size: 13px;
        }

        tr {
            /*height: 20px;*/
        }

        td {
            /*word-wrap: break-word;*/
            /*word-break: break-all;*/
        }

        .left {
            text-align: left;
        }

        .right {
            text-align: right;
        }

        .center {
            text-align: center;
        }

        .demo3 {
            border: 1px solid #1c1a1a;
            border-collapse: collapse;
        }

        .demo3 th, .demo3 td {
            border: 0.5px solid #1c1a1a;
            padding: 3px; /* 在单元格内部添加间距 */
        }

        .demo4 {
            border: 0px solid #1c1a1a;
            border-collapse: collapse;
        }

        .demo4 th, .demo4 td {
            border: 0px solid #1c1a1a;
            padding: 3px; /* 在单元格内部添加间距 */
        }
    </style>
</head>

<body>
<#escape x as x?html>
<#assign size=10>
<#if field_1?exists>

<#--计算所有明细合计-----begin----->

<#assign gysxx = "">
<#if field_1?size gt 0>
    <#assign gysxx = field_1[0].NAME1>
    ${gysxx!""}
</#if>

<#--计算所有明细合计-----=end=----->

<#assign page=(field_1?size/size)?ceiling>
<#list 1..page as c>
<#if c*size gt field_1?size>
    <#assign end=field_1?size-1 />
<#else>
    <#assign end=c*size-1 />
</#if>

<div>
    <#if page=c>
    <div>
        <#else>
        <div style="page-break-after:always;">
            </#if>
            <table class="headTable" width="100%" border="0" cellspacing="0" cellpadding="0"
                   style=" line-height: 20px;">
                <colgroup>
                    <col/>
                    <col width="5%"/>
                    <col width="15%"/>
                    <col width="15%"/>
                    <col width="15%"/>
                    <col width="12%"/>
                </colgroup>
                <tbody>
                <tr>
                    <td colspan="6" class="head" style="text-align: center">
                        <span>${YWZTMC!""}<br/>综合仓库结算清单</span>
                    </td>
                </tr>
                <tr>
                    <td colspan="6" style="text-align: right;">
                        ${c} /${page}
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <b>供应商：${gysxx!""}
                        </b>
                    </td>
                    <td colspan="2">
                        <b>记账日期：${BUDAT!""}</b>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <b>税额：${SE!""}</b>
                    </td>
                    <td colspan="2">
                        <b>价税合计：${JSHJ!""}</b>
                    </td>
                    <td colspan="2">
                        <b>发票号码：${FPHM!""}</b>
                    </td>
                </tr>
                </tbody>
            </table>
            <div width="100%">
                <table width="100%" border="0.1" cellspacing="0" cellpadding="0" class="demo3">
                    <colgroup>
                        <col width="5%"/>
                        <col width="14%"/>
                        <col/>
                        <col width="7%"/>
                        <col width="10%"/>
                        <col width="14%"/>
                        <col width="14%"/>
                    </colgroup>
                    <thead>
                    <tr class="center trMxTitle" style="height: 35px;">
                        <td>项次</td>
                        <td>物料编码</td>
                        <td>物料名称</td>
                        <td>单位</td>
                        <td>数量</td>
                        <td>凭证金额</td>
                        <td>发票金额</td>
                    </tr>
                    </thead>
                    <tbody>
                    <#assign forLineHeight =35 />
                    <#assign lastLineNum = 0 />

                    <#list (c-1) * size..end as i>
                        <#assign data=field_1[i]>
                        <tr style="height: ${forLineHeight!""}px">
                            <td class="center">
                                <#assign lastLineNum = lastLineNum + 1 >
                                ${lastLineNum}
                            </td>
                            <td class="center">${data.MBLNR!}</td>
                            <td>${data.MAKTX!}</td>
                            <td class="center">${data.BSTME!}</td>
                            <td class="right">${data.BSTMG!}</td>
                            <td class="right">${data.WRBTR!}</td>
                            <td class="right">${data.DMBTR!}</td>
                        </tr>
                    </#list>
                    <#assign lastPageMark = (c == page) />
                    <#if lastPageMark>
                        <!--==========================补充空行=============begin==========================-->
                        <#assign emptyLineNum = field_1?size - (c-1)*size />
                        <#if 0 != emptyLineNum>
                            <#list 1 .. (size - emptyLineNum) as i>
                                <tr style="height: ${forLineHeight!""}px">
                                    <td class="center">
                                        <#assign lastLineNum = lastLineNum + 1 >
                                        ${lastLineNum}
                                    </td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                </tr>
                            </#list>
                        </#if>
                        <!--==========================补充空行=============end ==========================-->
                    </#if>
                    </tbody>
                    <tr>
                        <td colspan="2" height="30px" class="center">
                            合计
                        </td>
                        <td colspan="3">
                        </td>
                        <td class="right">
                            ${HJPZJE!""}
                        </td>
                        <td class="right">
                            ${HJFPJE!""}
                        </td>
                    </tr>
                </table>
                <table border="0" cellspacing="0" cellpadding="0" width="100%" style="line-height: 15px;">
                    <colgroup>
                        <col width="35%"/>
                        <col width="33%"/>
                        <col width="32%"/>
                    </colgroup>
                    <tbody>
                    <tr style="height: 5px;">
                    </tr>
                    <tr>
                        <td style="text-align:left">收货单位</td>
                        <td style="text-align:left">制单人：${ZDR!""}</td>
                        <td style="text-align:left">送货单位</td>
                    </tr>
                    <tr>
                        <td colspan="2" style="text-align:left">及经手人（盖章）：${JSR1!""}</td>
                        <td style="text-align:left">及经手人（盖章）：${JSR2!""}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    </#list>
    </#if>
    </#escape>
</body>

</html>